import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    proxy: {
      '/integrated-workbench/v1/': {
        target: 'http://111.33.84.118:8195', // 后端服务器地址
        changeOrigin: true,
      },
    },
  },
  plugins: [uni()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"),
      "@/utils": path.resolve(__dirname, "./src/utils"),
      "@/api": path.resolve(__dirname, "./src/api"),
      "@/types": path.resolve(__dirname, "./src/types"),
      "@dcloudio/uni-ui": path.resolve(
        __dirname,
        "./node_modules/@dcloudio/uni-ui"
      ),
    },
  },
  define: {
    "import.meta.env.VITE_API_BASE_URL": JSON.stringify(
      process.env.VITE_API_BASE_URL || ""
    ),
  },

   css: {
	  preprocessorOptions: {
		  scss: {
			  // api: 'modern-compiler', // or 'modern'
			    api: 'modern', // or 'modern'
		  },
	  },
  },
});
